package com.alcj.service.impl;

import com.alcj.mapper.StationMapper;
import com.alcj.model.Station;
import com.alcj.service.StationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author : wangpf
 * @version : v1.0
 * @Package : com.alcj.service.impl
 * @Description : 汽车检测站业务逻辑实现类
 * @date : 2017/10/17 10:37
 */
@Service
public class StationServiceImpl implements StationService {

    /**
     * 车辆类型数据库接口
     */
    @Autowired
    StationMapper stationMapper;

    /**
     * @Author: wangpf
     * @Description: 获取车辆类型信息
     * @Date: 2017/10/17 10:59
     * @param: cityCode 城市ID
     * @return: stationList 检测站列表
     */
    @Override
    public List<Station> selectStationList(String cityCode) throws Exception {

        List<Station> stationList = this.stationMapper.selectStationList(cityCode);

        // 返回结果
        return stationList;
    }

    /**
     * @Author: wangpf
     * @Description: 获取检测站列表
     * @Date: 2017/10/17 10:59
     * @param: stationSearchCondition 页面检索条件
     * @return: stationList 检测站列表
     */
    @Override
    public List<Station> selectStationListByCondition(Map stationSearchCondition) throws Exception {

        List<Station> stationList = this.stationMapper.selectStationListByCondition(stationSearchCondition);

        // 返回结果
        return stationList;
    }

    /**
     * @Author: wangpf
     * @Description: 根据检测站ID获取检测站信息
     * @Date: 2017/10/30 10:59
     * @param: stationId 检测站ID
     * @return: stationDetail 检测站信息
     */
    @Override
    public Station selectStationDetailByStationId(String stationId) throws Exception {

        Station stationDetail = this.stationMapper.selectByPrimaryKey(stationId);

        // 返回结果
        return stationDetail;
    }
}
